package com.kwq.designPattern.construct.Filter;

import java.util.ArrayList;
import java.util.List;

/**
 * @author kangwanqiang
 * @date 2021/2/6
 * @description 标准接口的实现类，过滤gender=male
 */
public class CriteriaMaleImpl implements  Criteria{
    List<Integer> list = new ArrayList<>();
    public List<Person> meetCriteria(List<Person> persons) {
        List<Person> result = new ArrayList<>();
        for (Person person : persons) {
            if (person.getGender().equals(Person.Gender.MALE.value)){
                result.add(person);
            }
        }
        return result;
    }
}
